package com.stock.core.persistence.writer.stock;

import com.stock.api.domain.stock.StockHistoryBean;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface StockHistoryWriterMapper {
    /**
     * 根据主键删除数据库的记录,stock_history
     *
     * @param id
     */
    int deleteByPrimaryKey(Long id);

    /**
     * 新写入数据库记录,stock_history
     *
     * @param record
     */
    int insert(StockHistoryBean record);

    /**
     * 新写入数据库记录,stock_history
     *
     * @param list
     */
    int batchInsert(List<StockHistoryBean> list);

    /**
     * 动态字段,写入数据库记录,stock_history
     *
     * @param record
     */
    int insertSelective(StockHistoryBean record);

    /**
     * 根据指定主键获取一条数据库记录,stock_history
     *
     * @param id
     */
    StockHistoryBean selectByPrimaryKey(Long id);

    /**
     * 动态字段,根据主键来更新符合条件的数据库记录,stock_history
     *
     * @param record
     */
    int updateByPrimaryKeySelective(StockHistoryBean record);

    /**
     * 根据主键来更新符合条件的数据库记录,stock_history
     *
     * @param record
     */
    int updateByPrimaryKey(StockHistoryBean record);

    /**
     * 更新历史数据状态
     *
     * @param stockDate
     * @param stockCode
     * @return
     */
    int updateStatus(@Param("stockDate") String stockDate, @Param("stockCode")String stockCode);
}